package com.sjdang.springcloud.learning.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/learning/api")
@RestController
public class EurekaController {
	
	@Value("${server.port}")
	String port;
	
	@GetMapping("/hello")
	public String sayHello(@RequestParam(value="name", defaultValue="eureka")String name) {
		return "Hi " + name + ", I am from port:" + port;
	}

}
